<?php

	require_once("../include/connect.php");
	$tk = mysql_real_escape_string(strip_tags($_POST['tk']));
	$mk = mysql_real_escape_string(strip_tags(sha1($_POST['mk'])));
	
	$res = mysql_fetch_array(mysql_query(" SELECT count(id) as cnt FROM member WHERE user = '$tk' AND pass = '$mk' "));
	if($res['cnt'] > 0)
	{
		session_start();
		$_SESSION['log'] = true;
		$_SESSION['user'] = $tk;
		setcookie('userCookie',$tk, time()+900);
		echo "1";
	}
	else
	{
		echo "0";
	}

?>